package Permission;

public class PermissionProxy implements Permission {

    private RealPermission rp = new RealPermission();//代理对象对真实权限的引用

    public PermissionProxy(int level) {
        this.level = level;
    }

    private int level;//level=0是游客 非0代表不同级别的权限

    @Override
    public void doSome() {
        if(level == 0)
            System.out.println("您是游客，赶紧滚蛋");
        else
            rp.doSome();
    }
}
